package com.xujiang.common_plus.view;

import android.content.Context;

import com.xujiang.common_plus.R;

/**
 * @author xujiang
 * @version 2017-08-09 15:37
 */
public class ProgressDialog extends CPProgressDialog {

    public static Builder newBuilder(Context context) {
        return new Builder(context);
    }

    public static class Builder {
        private ProgressDialog dialog;
        public Builder(Context context){
            dialog = new ProgressDialog(context);
        }
        public Builder noClose(){
            dialog.setCancelable(false);
            return this;
        }

        public Builder setonDismissListener(final OnDismissListener listener){
            dialog.setOnDismissListener(listener);
            return this;
        }

        public ProgressDialog get(){
            return dialog;
        }
    }

    public ProgressDialog(Context context) {
        this(context, R.style.AppTheme_ProgressDialog);
    }

    public ProgressDialog(Context context, int theme) {
        super(context, theme);
    }
}
